package com.jams.goodox.activity.home;

import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.widget.TextView;

import com.jams.goodox.R;
import com.jams.library.commonAdapter.ListCommonAdapter;
import com.jams.library.commonAdapter.ListCommonViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/10/8.
 */

public class SettiongAdapter extends ListCommonAdapter<GoodsBean.Child>{
    public SettiongAdapter(Context context, List mDatas) {
        super(context, mDatas, R.layout.setting_item);
    }

    @Override
    public void convert(ListCommonViewHolder helper, GoodsBean.Child item, int position) {
        TextView txSet=helper.getView(R.id.tx_set);
        txSet.setText(item.getName());
        txSet.setBackground( ContextCompat.getDrawable(mContext,item.isChoose()?R.drawable.bg_cancel_red:R.drawable.bg_cancel_gray));
        txSet.setTextColor(ContextCompat.getColor(mContext,item.isChoose()?R.color.white:R.color.font_color_black));
    }
}
